package org.soc.timesheet.domain.repository;
import java.util.List;
import org.soc.timesheet.domain.SubProjects;
import org.soc.timesheet.domain.Timesheet;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.roo.addon.layers.repository.jpa.RooJpaRepository;
import org.springframework.stereotype.Repository;

@Repository
@RooJpaRepository(domainType = Timesheet.class)
public interface TimesheetRepository extends JpaRepository<Timesheet, String>, JpaSpecificationExecutor<Timesheet> {
	
	public List<Timesheet> findByIdSubProjectIn(List<SubProjects> subProjects);

	@Query("delete from Timesheet t where t.idSubProject.id=?1")
	@Modifying
	public void deleteBySubproject(int idSubProjects);
}
